package com.example.demo0630.bean;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author lzh
 * @date 2020/6/30 - 10:35
 */
@Component
@Data
public class PersonCfg {
    //直接使用@value
    @Value("${person.name}")
    //从配置文件中取值
    private String name;

    @Value("${person.id}")
    private String id;

    @Value("${person.nickName}")
    private String nickName;

    @Value("#{11*2}")
    //#{SPEL} Spring表达式
    private Integer age;
}
